package com.chenxiao.responsibilityChain.design;

/**
 * @Author: CX
 * @Date: Created in  2023/05/28 16:34
 * @version: v1.0
 * @Description: TODO
 **/
public class Manager extends DesignModel {

    Manager(String name) {
        super(name);
    }

    @Override
    public void approve(int amount) {
        if(amount >= 5000) {
          //  this.setNextApprove(new CFO("CFO名称"));
            System.out.println("无权限审批，【"+name+"】");
            this.NextApprover.approve(amount);
        }else{
            System.out.println("审批成功，【"+name+"】");
        }
    }
}
